package com.irdstudio.efp.report.service.impl;

import com.irdstudio.basic.framework.core.base.FrameworkService;
import com.irdstudio.efp.report.service.dao.RptCompensationStatementDao;
import com.irdstudio.efp.report.service.domain.RptCompensationStatement;
import com.irdstudio.efp.report.service.facade.RptCompensationStatementService;
import com.irdstudio.efp.report.service.vo.RptCompensationStatementVO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 需求编号：【 】<br/>
 * 问题编号：【 】<br/>
 * 开发人员：【肖均辉】<br/>
 * 创建日期：【2019-06-06】<br/>
 * 功能描述：代偿结清客户明细报表<br/>
 * @author xiaojunhui<br/>
 */
@Service("rptCompensationStatementService")
public class RptCompensationStatementServiceImpl implements RptCompensationStatementService, FrameworkService {

	private static Logger logger = LoggerFactory.getLogger(RptCompensationStatementServiceImpl.class);

	@Autowired
	private RptCompensationStatementDao rptCompensationStatementDao;

	@Override
	public Integer insertOrUpdateBatch(List<RptCompensationStatementVO> list) {
		try {
			if (list == null || list.size() < 1) {
				return 0;
			}
			return this.rptCompensationStatementDao.insertOrUpdateBatch((List<RptCompensationStatement>)beansCopy(list, RptCompensationStatement.class));
		} catch (Exception e) {
			e.printStackTrace();
			logger.error("批量插入并更新数据出错：",e);
		}
		return 0;
	}
}